//
//  CSImageTableViewController.m
//  classroom
//
//  Created by Macx on 16/7/31.
//  Copyright © 2016年 LiuZhuo. All rights reserved.
//

#import "CSImageTableViewController.h"
#import "CSTImageTableViewCell.h"
#import "CSCellModel.h"
@interface CSImageTableViewController()
@property(nonatomic,strong)NSArray * dataArray;
@end
@implementation CSImageTableViewController
-(NSArray *)dataArray{
    
    if (_dataArray ==nil) {
        NSString * path = [[NSBundle mainBundle]pathForResource:@"image.plist" ofType:nil  ];
        NSArray * temp = [NSArray arrayWithContentsOfFile:path];
        NSMutableArray * muta = [NSMutableArray array];
        for (NSDictionary *dict in temp) {
            CSCellModel * imageModel = [ CSCellModel mj_objectWithKeyValues:dict];
            [muta addObject:imageModel];
        }
        _dataArray=muta;
    }
    return _dataArray;
}
-(void)viewDidLoad{
    [super viewDidLoad];
    
}


-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    
    return self.dataArray.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    CSTImageTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"haha"];
    CSCellModel * model = self.dataArray[indexPath.row];
    cell.model = model;
    return cell;
    
    
}



@end
